<?php
namespace app\work\validate;
use think\Validate;

/**
 * 工作记录活动开展信息验证器
 * Created by PhpStorm.
 * User: tyll
 * Date: 2019/10/30
 * Time: 15:32
 */
class WorkRecordActive extends Validate{

    protected $rule = [
        'name'        => 'require',
        'content'     => 'require',
        'person_num'  => 'require|integer|gt:0',
        'pic'         => 'require',
    ];

    protected $message = [
        'name.require'          => '名称必须填写',
        'content.require'       => '内容必须填写',
        'person_num.require'    => '人数必须填写',
        'person_num.integer'    => '人数填写错误',
        'person_num.gt'         => '人数填写错误',
        'pic.require'           => '图片必须填写',
    ];

    protected $scene = [
        'add'  => ['name','content','person_num'],
        'edit' => ['name','content','person_num']
    ];
}